package com.mzy.basics.network;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/5/18 13:28
 * @Version 1.0
 */
public class TestGetNetWorkAll {

    public static void main(String[] args) throws Exception {
        List<NetworkInterface> networkInterfaces = NetworkUtil.getNetworkInterfaces();
        networkInterfaces.forEach(e-> System.out.println(e));

        InetAddress inetAddress = InetAddress.getAllByName("224.0.0.5")[0];
        System.out.println(inetAddress);
        // 发udp启用多网卡

    }

}
